<template>
  <div class="goods-footer">
    <div class="left">
      <div class="goods-detail">
        <div class="head">商品详情</div>
        <div class="content">
          <img
              v-for="(item,index)  in goods.details.pictures" :key="index"
              :src="item"
              alt=""
          />
        </div>
      </div>
    </div>
    <div class="right">
      <div class="goods-hot">
        <h3>24小时热销榜</h3>
<!--        <PartItem v-for="item in goods.hotByDay" :key="item.id" :goods="item"/>-->
        <div v-for="item in goods.hotByDay" :key="item.id">
          <router-link
              :to="`/particulars/${item.id}`"
              class="goods-item"
              @click="tiao"
          >
            <img :src="item.picture" alt="" />
            <p class="name ellipsis">{{ item.name }}</p>0
            <p class="desc ellipsis">{{ item.desc }}</p>
            <p class="price">¥{{ item.price }}</p>
          </router-link>
        </div>

      </div>
      <div class="goods-hot">
        <h3>周热销榜</h3>
        <div v-for="item in goods.similarProducts" :key="item.id">
          <router-link
              :to="`/particulars/${item.id}`"
              class="goods-item"
              @click="tiao"
          >
            <img :src="item.picture" alt="" />
            <p class="name ellipsis">{{ item.name }}</p>0
            <p class="desc ellipsis">{{ item.desc }}</p>
            <p class="price">¥{{ item.price }}</p>
          </router-link>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import PartItem from "@/views/particulars/components/PartItem";
export default {
  name: "PartFooter",
  props:["goods"],
  comments:{
    PartItem
  },
  methods:{
    tiao(){
      console.log(123)
      this.$router.push("0")
    }
  }
}
</script>

<style scoped lang="scss">
  .goods-footer {
    display: flex;
    .left {
      width: 940px;
      margin-right: 20px;
    }
    .right {
      width: 280px;
      min-height: 1000px;
    }
  }
  .goods-detail {
    background: #fff;
    .head {
      height: 70px;
      line-height: 70px;
      font-size: 18px;
      padding: 0 40px;
      border-bottom: 1px solid #f5f5f5;
    }
    .content {
      padding: 40px;
      img {
        width: 100%;
      }
    }
  }
  .goods-hot {
    h3 {
      height: 70px;
      background: #e26237;
      color: #fff;
      font-size: 18px;
      line-height: 70px;
      padding-left: 25px;
      margin-bottom: 10px;
      font-weight: 400;
    }
    h3::v-deep .goods-item {
      background: #fff;
      width: 100%;
      margin-bottom: 10px;
      img {
        width: 200px;
        height: 200px;
      }
      p {
        margin: 0 10px;
      }
    }
    h3:hover {
      transform: none;
      box-shadow: none;
    }
  }
  .goods-item {
    display: block;
    width: 220px;
    padding: 20px 30px;
    text-align: center;
    background: #fff;
    transition: all 0.5s;
    margin-bottom: 10px;
    &:hover {
      transform: translate3d(0, -3px, 0);
      box-shadow: 0 3px 8px rgb(0 0 0 / 20%);
    }
    img {
      width: 160px;
      height: 160px;
    }
    p {
      padding-top: 10px;
    }
    .name {
      font-size: 16px;
    }
    .desc {
      color: #999;
      height: 29px;
    }
    .price {
      color:#cf4444;
      font-size: 20px;
    }
  }
</style>